package shg.book.size
{
	import com.adobe.serialization.json.JSON;
	import com.hurlant.crypto.Crypto;
	import com.hurlant.crypto.prng.Random;
	import com.hurlant.crypto.symmetric.ICipher;
	import com.shuhg.book.write.BookModel;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.IBitmapDrawable;
	import flash.filesystem.File;
	import flash.filesystem.FileMode;
	import flash.filesystem.FileStream;
	import flash.geom.Matrix;
	import flash.system.Capabilities;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.utils.ByteArray;
	
	import mx.controls.HTML;
	import mx.graphics.codec.JPEGEncoder;
	import mx.utils.UIDUtil;
	
	/**
	 * 该类里面存储的是一些常量
	 * */
	public class BookData
	{
		/**
		 * 是否要将当前的数据插入数据库
		 * */
		static public var isInsert:Boolean=false;
		/**
		 * 数据ID号
		 * */
		static public var bookID:String;
		/**
		 * 书籍名称
		 * */
		static public var bookName:String="";
		/**
		 * 保存文件路径
		 * */
		static public var filePath:String;
		/**
		 * 显示在书架上的书本宽度
		 * */
		public static const _WIDTH:Number=75*2;
		/**
		 *  显示在书架上的书本的高度
		 * */
		public static const _HEIGTH:Number=100*2;
		/**
		 * 长度为10的静态变量
		 * */
		static public var LENGTH:int=10;
		/**
		 * 书籍的ID号长度为32
		 * */
		static public var BOOK_ID:int=32;
		/**
		 * 长度为16的密钥
		 * */
		static public var AES_LENGTH:int=16;
		/**
		 * 空白页面
		 * */
		static public var nullPage:String="assets/page/bg/bg4.gif";
		/**
		 * 左页面和右页面的距离
		 * */
		static public var PADDING_SPINE:Number=20;
		/**
		 * 书籍左右边框的分别宽度30像素
		 * */
		[Bindable]
		static public var BORDER_WIDTH:Number=30;
		
		static public var EXTENSION:String=".shg";
		//文本内容到边框的距离，这里和HTML文本文件里面的设置是一样的
		public static const BORDER_MARGIN:Number=30
		//主界面的宽度
		public static const MAIN_WIDTH:Number=1020;
		//住界面的高度
		public static const MAIN_HEIGTH:Number=500;
		//书本高度
		static public  var  BOOK_HEIGTH:Number=680;
		//书本宽度
		static public  var BOOK_WIDTH:Number=1180;
		//页面内容显示的高度,BORDER_MARGIN*2（距离上边框30下边框30）
		//static public  var PAGE_CONTENT_HEIGTH:Number=BOOK_HEIGTH-(BORDER_MARGIN*2);
		//页面内容的显示宽度 BOOK_WIDTH/2(因为一面书包括2页)，BORDER_MARGIN*2（距离左边框30右边框30）
		//static public  var PAGE_CONTENT_WIDTH:Number=(BOOK_WIDTH/2)-(BORDER_MARGIN*2);
		//页码的显示位置X
		public static const PAGE_SIZE_X:Number=getContentWidth();
		//页面的显示位置Y
		public static const PAGE_SIZE_Y:Number=BOOK_HEIGTH-50/2-5;
		//屏幕的垂直高度
		public static const  SCREEN_Y:Number=flash.system.Capabilities.screenResolutionY;
		//屏幕的水平宽度
		public static const  SCREEN_X:Number=flash.system.Capabilities.screenResolutionX;
		//主界面设计
		public static const HEAD_HEIGHT:Number=120;
		public static const CENTER_LEFT:Number=150;
		public static const CENTER_RINGHT_WIDTH:Number=750;
		public static const CENTER_RINGHT_HEIGHT:Number=450;
		//登录界面的大小
		public static const LOGIN_SIZE_HEIGHT:Number=100;
		public static const LOGIN_SIZE_WIDTH:Number=180;
		//展览在书架上的书本大小
		public static const MAIN_BOOK_WIDTH:Number=74;
		public static const MAIN_BOOK_HEIGHT:Number=100;
		//书籍版本信息长度
		public static const EDITION_LENGTH:Number=15;
		//文本整体
		[Bindable]  
		public static var FONT:String="Verdana";
		[Bindable]
		public static var COLOR:uint=0x333333;
		[Bindable]
		public static var SIZE:Number=14;
		[Bindable]
		public static var LEADING:Number = 5;
		[Bindable]
		public static var LETTERSPACING:Number = 2;
		//批注静态变量
		public static var penStyle:String;
		//线条颜色
		[Bindable]
		public static  var lineColor:uint=0;
		//透明度
		public static var lineAlpha:Number=1;
		//大小
		public static var lineSize:Number=1;
		//画刷图案
		public static var flowerIndex:Number=0;
		//选择花纹
		[Embed(source="assets/image/flower/0.png")]
		public  const flower0:Class;
		[Embed(source="assets/image/flower/1.png")]
		public  const flower1:Class;
		[Embed(source="assets/image/flower/2.png")]
		public  const flower2:Class;
		[Embed(source="assets/image/flower/3.png")]
		public  const flower3:Class;
		[Embed(source="assets/image/flower/4.png")]
		public  const flower4:Class;
		[Embed(source="assets/image/flower/5.png")]
		public  const flower5:Class;
		[Embed(source="assets/image/flower/6.png")]
		public  const flower6:Class;
		[Embed(source="assets/image/flower/7.png")]
		public  const flower7:Class;
		[Embed(source="assets/image/flower/8.png")]
		public  const flower8:Class;
		//下拉列表选择
		[Bindable]
		public static var bs:XML=new XML(
			<items>
				<item icon="flower0"/>
				<item icon="flower1"/>
				<item icon="flower2"/>
				<item icon="flower3"/>
				<item icon="flower4"/>
				<item icon="flower5"/>
				<item icon="flower6"/>
				<item icon="flower7"/>
				<item icon="flower8"/>
			</items>
		);
		
		[Bindable]
		public static var indexXML:XML=
			<menu>
				<item label="目录"></item>
			</menu>;
		
		public function BookData()
		{
		}
		
		static public function getContentWidth():Number{
			return (BOOK_WIDTH/2)-(BORDER_MARGIN*3);
		}
		static public function getContentHeigth():Number{
			return BOOK_HEIGTH-(BORDER_MARGIN*2);
		}
		//纸张模式
		[Bindable]
		static public var HARDPAGE:Boolean=false;
		//开启翻页声音
		[Bindable]
		static public var TURNMUSIC:Boolean=true;
		//自动翻页
		[Bindable]
		static public var TURNPAGE:Boolean=false;

		
	}
}